<script type="text/javascript">
  function checkPassword()
  {
    document.getElementById('unameId').value = '';
    document.getElementById('unameId').type = 'password';
  }
</script>

<input type="text" value="Please enter password" id="unameId" onclick="checkPassword()">
